<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />

    <title>Fetch polyfill example</title>

    <link rel="stylesheet" href="" />
  </head>

  <body>
    <h1>Fetch basic example</h1>

    <img src="" class="my-image" alt="A flower" />

    <!-- Minified version of `es6-promise-auto` below. -->
    <script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script>
    <script src="fetch.js"></script>
    <script>
      var myImage = document.querySelector(".my-image");

      fetch("flowers.jpg").then(function (response) {
        response.blob().then(function (myBlob) {
          var objectURL = URL.createObjectURL(myBlob);
          myImage.src = objectURL;
        });
      });
    </script>
  </body>
</html>
